#ifndef			__BT_H__
#define			__BT_H__






#include "def.h"
#include "fifo.h"



#ifndef _GLOBAL_BT_	
	#define	 	BT_EXTERN		extern
	EXPORT_FIFO_API(bleRxFifo,200,UINT16,UINT16)	
	EXPORT_FIFO_API(bleRxBitFifo,200,BYTE,UINT16)	
	EXPORT_FIFO_API(bleTxFifo,300,BYTE,UINT16)	
#else
	#define		BT_EXTERN	
	NEW_FIFO(bleRxFifo,200,UINT16,UINT16)	
	NEW_FIFO(bleRxBitFifo,200,BYTE,UINT16)
	NEW_FIFO(bleTxFifo,300,BYTE,UINT16)
#endif









typedef struct
{
	BYTE btTxBitStatus;
	
	BYTE frameStatus;
	BYTE frameType;
	BYTE frameLength;
	BYTE frameMaxLength;
	BYTE frameData[128];
	BYTE frameCheckSum;
	
	BYTE wgBitOddCnt;
	BYTE wgBitLength;
	BYTE wgRxData;
	BYTE wgBitStatus;
	
	UINT32 debugDelayTimer;
	UINT32 btTxBitDelayTimer;
}T_BT_INFO;






BT_EXTERN  T_BT_INFO btInfo;


BT_EXTERN void btInit(void);
BT_EXTERN void btProc(void);
BT_EXTERN void ipcEventBTProc(ULONG enumWhatEvent,ULONG lPara,BYTE *p,uint8_t length);




#endif
